import React, { useReducer } from "react";
import useStore from "@/store/model";
import MyContent from "@/store/my-context";
import PageContainer from "@/components/navbar";
const HomePage: React.FC = ({ children }) => {
  const { store, reducer } = useStore();
  const [state , dispatch] = useReducer(reducer, store);
  return (
    <MyContent.Provider value={{ state, dispatch }}>
      <div 
      style={{ height: "100vh", 
      overflow: "hidden" }} 
      onClick={()=>{
        if (state.showList) {
          dispatch({ type: "SET_SHOW"})
        }
      }}
      >
        <PageContainer>{children}</PageContainer>
      </div>
    </MyContent.Provider>
  );
};

export default HomePage;
